package com.boot.security.server.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.boot.security.server.model.AppApponit;

@Mapper
public interface AppApponitDao {

    @Select("select * from app_apponit t where t.id = #{id}")
    AppApponit getById(Long id);

    @Select("select * from app_apponit")
    List<AppApponit>  getBylist(@Param("openId") String openId);

    @Delete("delete from app_apponit where id = #{id}")
    int delete(Long id);

    int update(AppApponit appApponit);
    
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into app_apponit(regsterappid, regno, channel, hostcode, deptcode1, deptcode2, cardno, cardtype, patientname, idcard, idcardtype, sex, birthday, areacode, doctorcode, titletype, regdate, reghalf, reghour, regtype, extparam, phone, extparam1, Column_25,paytype,pidtype,openid,orderdate,totalfee,registerdate,registerstatus,feestatus,clinicroom,receiptsn,checkopercode,checkopername,checktime,sign,cert,getpersoninfo,trade,divide,feetype,hisregno,recordsequence,refundtime,histradeno) values(#{regsterappid}, #{regno}, #{channel}, #{hostcode}, #{deptcode1}, #{deptcode2}, #{cardno}, #{cardtype}, #{patientname}, #{idcard}, #{idcardtype}, #{sex}, #{birthday}, #{areacode}, #{doctorcode}, #{titletype}, #{regdate}, #{reghalf}, #{reghour}, #{regtype}, #{extparam}, #{phone}, #{extparam1}, #{Column25}, #{paytype}, #{pidtype},#{openid},#{orderdate},#{totalfee},#{registerdate},#{registerstatus},#{feestatus},#{clinicroom},#{receiptsn},#{checkopercode},#{checkopername},#{checktime},#{sign},#{cert},#{getpersoninfo},#{trade},#{divide},#{feetype},#{hisregno},#{recordsequence},#{refundtime},#{histradeno})")
    int save(AppApponit appApponit);
    
    int count(@Param("params") Map<String, Object> params);

    List<AppApponit> list(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
}
